﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using CrystalDecisions.CrystalReports.Engine;

using BLL;
using DAL;
using Models;
using System.Data;
using System.Text;
using System.Xml;
using Gift.WebApp;
public partial class backstage_payment_list : System.Web.UI.Page
{
    // Fields
    protected string xmlPath = "/cn/xml/payment.xml";

    // Methods
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((HttpContext.Current.Session["admin_user"] == null) && (HttpContext.Current.Session["language_version"] == null))
        {
            base.ClientScript.RegisterStartupScript(base.GetType(), "sJs", "top.location=\"login.html\";", true);
        }
    }

    protected StringBuilder PaymentBind()
    {
        StringBuilder builder = new StringBuilder();
        try
        {
            XmlDocument document = new XmlDocument();
            document.Load(base.Server.MapPath(this.xmlPath));
            XmlNodeList childNodes = document.SelectSingleNode("paymentMethod").ChildNodes;
            builder.AppendLine("<tbody>");
            foreach (XmlNode node in childNodes)
            {
                XmlElement element = (XmlElement)node;
                builder.AppendLine("<tr>");
                builder.AppendLine("<td><img style=\"border:solid 1px #d3d3d3;\" src=\"" + element.GetAttribute("image") + "\" alt=\"" + element.GetAttribute("title") + "\" /></td>");
                builder.AppendLine("<td>" + element.GetAttribute("title") + "</td>");
                builder.AppendLine("<td>" + element.GetAttribute("remark") + "</td>");
                builder.AppendLine("<td><a href=\"" + element.GetAttribute("url") + "\" target=\"_blank\">申请接口权限</a></td>");
                builder.AppendLine("<td>" + ((element.GetAttribute("checked") == "true") ? "是" : "否") + "</td>");
                builder.AppendLine("<td><a href=\"payment.aspx?id=" + element.GetAttribute("id") + "\"><img src=\"images/edt.gif\" alt=\"配置\" />配置</a></td>");
                builder.AppendLine("</tr>");
            }
            builder.AppendLine("</tbody>");
        }
        catch
        {
        }
        return builder;
    }

}